import { post } from './index'

export default function (id) {
  return new Promise(async res => {
    let status = undefined
    try {
      const { data } = await post(`/admin/survey/toggle_over`, { id })
      if (data.msg === 'success') {
        status = true
      } else console.warn(data.msg)
    } catch (e) {
      console.error(e.message)
    }
    res(status)
  })
}
